home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 June / MacFormat 25.iso / Shareware City / Developers / OutOfPhase1.1 Source / OutOfPhase Folder / Level 1 Extensions 04Jan95 / WindowDispatcher.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-01  |  3.0 KB  |  80 lines  |  [TEXT/KAHL]

  1. /* WindowDispatcher.h */
  2.  
  3. #ifndef Included_WindowDispatcher_h
  4. #define Included_WindowDispatcher_h
  5.  
  6. /* WindowDispatcher module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Screen */
  12. /* EventLoop */
  13. /* Menus */
  14. /* Array */
  15. /* Memory */
  16.  
  17. #include "Screen.h"
  18. #include "EventLoop.h"
  19. #include "Menus.h"
  20.  
  21. struct GenericWindowRec;
  22. typedef struct GenericWindowRec GenericWindowRec;
  23.  
  24. /* initialize internal data structures for the window dispatch handler */
  25. MyBoolean                        InitializeWindowDispatcher(void);
  26.  
  27. /* dispose of internal data structures for the window dispatch handler */
  28. void                                ShutdownWindowDispatcher(void);
  29.  
  30. /* check in a new window, install callback routines, and obtain a unique identifier */
  31. GenericWindowRec*        CheckInNewWindow(WinType* ScreenID, void* Reference,
  32.                                             void (*WindowDoIdle)(void* Reference, MyBoolean CheckCursorFlag,
  33.                                                         OrdType XLoc, OrdType YLoc, ModifierFlags Modifiers),
  34.                                             void (*WindowBecomeActive)(void* Reference),
  35.                                             void (*WindowBecomeInactive)(void* Reference),
  36.                                             void (*WindowResized)(void* Reference),
  37.                                             void (*WindowDoMouseDown)(OrdType XLoc, OrdType YLoc,
  38.                                                         ModifierFlags Modifiers, void* Reference),
  39.                                             void (*WindowDoKeyDown)(unsigned char KeyCode,
  40.                                                         ModifierFlags Modifiers, void* Reference),
  41.                                             void (*WindowClose)(void* Reference),
  42.                                             void (*WindowMenuSetup)(void* Reference),
  43.                                             void (*WindowDoMenuCommand)(void* Reference,
  44.                                                         MenuItemType* MenuItem));
  45.  
  46. /* notify the window dispatcher that this window is no longer with us */
  47. void                                CheckOutDyingWindow(GenericWindowRec* Window);
  48.  
  49. /* get the identifier for the currently active window.  returns NIL */
  50. /* if there is no active window */
  51. GenericWindowRec*        GetCurrentWindowID(void);
  52.  
  53. /* dispatch one of the specified events to the currently active window */
  54. /* Pass NIL for Window if there is no active window */
  55. void                                DispatchDoIdle(WinType* Window, MyBoolean CheckCursorFlag,
  56.                                             OrdType XLoc, OrdType YLoc, ModifierFlags Modifiers);
  57. void                                DispatchActiveWindowJustChanged(WinType* NewWindow);
  58. void                                DispatchWindowJustResized(WinType* Window);
  59. void                                DispatchDoMouseDown(WinType* Window, OrdType XLoc, OrdType YLoc,
  60.                                             ModifierFlags Modifiers);
  61. void                                DispatchDoKeyDown(WinType* Window, unsigned char KeyCode,
  62.                                             ModifierFlags Modifiers);
  63. void                                DispatchCloseWindow(WinType* Window);
  64. void                                DispatchMenuStarting(WinType* Window);
  65. void                                DispatchProcessMenuCommand(WinType* Window, MenuItemType* MenuItem);
  66.  
  67. struct IdleTaskSignature;
  68. typedef struct IdleTaskSignature IdleTaskSignature;
  69.  
  70. /* install an idle task to be executed whenever an idle event occurs */
  71. IdleTaskSignature*    DispatchInstallIdleTask(void (*Proc)(void* Refcon), void* Refcon);
  72.  
  73. /* remove an idle task */
  74. void                                DispatchRemoveIdleTask(IdleTaskSignature* Signature);
  75.  
  76. /* dispatch a callback to all installed idle tasks */
  77. void                                DispatchIdleTaskCallback(void);
  78.  
  79. #endif
  80.